<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1. 计算 (0+1+2+3+4)*10 的结果 100

      const arr = [1, 2, 3, 4]

      // arr.reduce((累加的结果, 当前循环项) => 计算表达式, 初始值)
      const result = arr.reduce((sum, item) => (sum += item * 10), 0)

      console.log('result:', result)
    </script>
  </body>
</html>
